﻿<?php
class page_base {
	private $corps;
	private $page;
	private $page_header = "Tickekting";
	private $small_ph = "";
	
	// Permet d'afficher le contenu de chaque page
	public function __construct($p) {
		$this->page = $p;
	}
	
	/**
	 * ****** Gestion des setters ******************
	 */
	public function __set($propriete, $valeur) {
		switch ($propriete) {
			case 'corps' :
				{
					$this->corps = $valeur;
					break;
				}
			case 'titre' :
				{
					$this->titre = $valeur;
					break;
				}
		}
	}
	protected function affiche_contenu() {
		echo $this->corps;
	}
	
	/**
	 * ***********Gestion des styles ********************
	 */
	private function affiche_style() {
		?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="Service d'administration du logicien Oremia">
<meta name="author" content="Pelletier Jordan">

<!-- bootstrap widget theme -->
<!-- tablesorter plugin -->
<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/controleur.js"></script>
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link href="plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet">
<link
	href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"
	rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Righteous'
	rel='stylesheet' type='text/css'>
<link href="plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<link href="plugins/fullcalendar/fullcalendar.css" rel="stylesheet">
<link href="plugins/xcharts/xcharts.min.css" rel="stylesheet">
<link href="plugins/select2/select2.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<?php
	}
	
	/**
	 * ************ Affichage du pied de la page **************************
	 */
	private function affiche_footer() {
		?>
<hr>
<i>&copy; 2015 <a href="http://www.zumatec.com/" target="blank">Zumatec</a>,
	tous droits r&eacuteserv&eacutes.
</i>
<?php
	}
	protected function affiche_page_header() {
		?>

<?php
	}
	
	/**
	 * ************ Affichage du menu de la page (non connecté)**************************
	 */
	protected function affiche_menu() {
		?>

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
	<div class="navbar-inner">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target=".navbar-ex1-collapse">
				<span class="sr-only">Toggle navigation</span>
			</button>
			<a class="navbar-brand" href="connexion.php"><i></i>Serveur de
				ticketing</a>
		</div>
		<div class="container">

			<div class="collapse navbar-collapse navbar-ex1-collapse">
				<ul class="nav navbar-nav side-nav">
					<li><a href="index.php"><i class="fa fa-fw fa-home"></i> Accueil</a>
					</li>
					<li><a href="connexion.php"><i class="fa fa-sign-in"></i> Connexion</a>
					</li>
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
	</div>
</div>
<?php
	}
	
	/**
	 * ****************** Fonction permettant l'affichage de la page *************
	 */
	public function affiche() {
		?>
<!DOCCTYPE html>
<html lang='fr'>
<head>
<title>Ticketing</title>
<meta charset="utf-8" />
                                <?php
		$this->affiche_style ();
		?>
                        </head>
<body>
	<div id="wrapper">
                                <?php
		$this->affiche_menu ();
		?>
                         <div id="page-wrapper">

			<div class="container-fluid">

				<!-- Page Heading -->
                        <?php
		$this->affiche_page_header ();
		$this->affiche_contenu ();
		?>
                </div>
		</div>

</body>

</html>

<?php
	}
}
?>